#include "dominion.h"
#include "rngs.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>

int main (int argc, char **argv)
{
	//create a new game struct with 2 players
	//deck count 10, hand count 5, num buys 1
	//card in position 1
	int player = 0;
	struct gameState *test = newGame();
	test->numPlayers = 2;
	test->handCount[player] = 5;
	test->handCount[1] = 5;
	test->hand[player][1] = council_room;
	test->deckCount[player] = 10;
	test->deckCount[1] = 10;
	test->numBuys = 1;
	test->playedCardCount = 0;
	
	//should increase handcount by 4, buys by 1
	//discard by 1
	//other player by + 1 card
	councilRoomCard(test, 1, 0);
	
	if(test->handCount[player] == 8)
		{
			printf("Test passed.\n");
		}
	else
		printf ("Test failed, hand count: %d\n", test->handCount[player]);
		
	if(test->numBuys == 2)
		{
			printf("Test passed.\n");
		}
	else
		printf ("Test failed, buys: %d\n", test->numBuys);
	
	if(test->handCount[1] == 6)
		{
			printf("Test passed.\n");
		}
	else
		printf ("Test failed, player 1 handcount: %d\n", test->handCount[1]);
		
	if(test->playedCardCount == 1)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, discard: %d\n", test->playedCardCount);
		
		
	//add cards to a max hand
	//player 0 playing the council room card with hand
	//should not be able to add more cards
	councilRoomCard(test, 1, 0);
	test->handCount[player] = 500;
	
	if(test->handCount[player] == 503)
		{
			printf("Added cards to a maxed out hand.\n");
		}
		
		else
			printf ("Test passed.\n");
			
	//player 0 playing council room card
	//when player 1 has a max hand
	councilRoomCard(test, 1, 0);
	test->handCount[1] = 500;
	
	if(test->handCount[1] == 501)
		{
			printf("Added cards to a maxed out hand.\n");
		}
		
		else
			printf ("Test passed. %d\n");
	

	return 0;
}